package com.uni.db;

import org.hibernate.criterion.Restrictions;

import com.uni.domain.Course;
import com.uni.domain.Discipline;
import com.uni.domain.User;

public class CourseServiceImpl extends GenericServiceImpl<User> implements CourseService {

	@Override
	public boolean isCouseWithDiscepline(Discipline discipline) {
		return getSession().createCriteria(Course.class)
		.add(Restrictions.eq("discipline", discipline))
		.list()
		.size() == 0;
	}

}
